package current;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by dycong on 2017/4/29.
 */
public class ThisEscape {
    private String str="test";
    class InnerClass{
    }
    public ThisEscape(List list){
        list.add(new InnerClass());
    }
}
 class Test{
     public static void main(String[] args) {
         List<ThisEscape.InnerClass>list=new ArrayList<>();
         ThisEscape thisEscape=new ThisEscape(list);
         ThisEscape.InnerClass innerClass=list.get(0);
     }
     // TODO: 2017/4/29 发布内部类实例会隐含的发布外部类实例，this 逸出，不要再构造中使用 this 逸出，即使在最后一行逸出，也被认为 ThisEscape 未构造完成 
}
